﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;


namespace Kingdom_of_the_Dragon
{
    class LiveObject
    {
        protected Texture2D texture;
        protected Vector2 position;

        protected int life = 100;
        protected int speed;
        protected int gravity = 2;

        protected float angle_direct;
        protected float radians_direct;

        protected static bool olhandoDireita = true;

        public Vector2 Position { get { return position; } }
        public Texture2D Texture { get { return texture; } }
        public int Life { get { return life; } }
        public float Angle_direct { get { return angle_direct; } }
        public float Radians_direct { get { return radians_direct; } }

        public void Draw(SpriteBatch spriteBratch, Vector2 cameraorigem, float angle_direct, float radians_direct)
        {
            spriteBratch.Begin();
            spriteBratch.Draw(texture, new Rectangle(((int)cameraorigem.X + (int)position.X), ((int)cameraorigem.Y + (int)position.Y), (int)texture.Width, (int)texture.Height),
                new Rectangle(0, 0, texture.Width, texture.Height),
                Color.White, radians_direct,
                new Vector2(texture.Width / 2, texture.Height / 2),
                olhandoDireita ? SpriteEffects.None : SpriteEffects.FlipVertically, 0f);
            spriteBratch.End();
        }
        public void Draw(SpriteBatch spriteBratch, Vector2 cameraorigem)
        {
            spriteBratch.Begin();
            spriteBratch.Draw(texture, new Rectangle(((int)cameraorigem.X + (int)position.X), ((int)cameraorigem.Y + (int)position.Y), (int)texture.Width, (int)texture.Height),
                new Rectangle(0, 0, texture.Width, texture.Height),
                Color.White, radians_direct,
                new Vector2(texture.Width / 2, texture.Height / 2),
                olhandoDireita ? SpriteEffects.None : SpriteEffects.FlipVertically, 0f);
            spriteBratch.End();
        }
    }
}
